Hi alle!
Ich hatte vor einigen Tagen die Idee, ein Anti-Verrat System zu machen! D.h.: Wenn Spieler X einmal ein Skin/Gang auswaehlt, kann er diese nicht mehr aendern und wird ab sofort fuer immer mit diesem spielen:
SetPlayerSpawn(playerid) // You don't need to write public at the first, unless you are going to call this callback with a timer.
{
new p_skin = gPlayerSkinForEver[playerid]; // This is BALLAS.
if(p_skin == 102 || p_skin == 103 || p_skin == 104) {
new Float:x, Float:y, Float:z,angle;
SetSpawnInfo(playerid, 1, gPlayerSkinForEver[playerid], x, y, z, angle, 0, 0, 0, 0, 0, 0);
} // This is GROOVE.
else if(p_skin == 267 || p_skin == 271 || p_skin == 270 || p_skin == 0 || p_skin == 105 || p_skin == 106 || p_skin == 107) { // You need to change these values.
new Float:x,Float:y,Float:z,angle;
SetSpawnInfo(playerid, 2, gPlayerSkinForEver[playerid], x, y, z, angle, 0, 0, 0, 0, 0, 0);
} // This is VAGOS.
else if(p_skin == 108 || p_skin == 109 || p_skin == 110) {
new Float:x, Float:y, Float:z,angle; //
SetSpawnInfo(playerid, 3, gPlayerSkinForEver[playerid], x, y, z, angle, 0, 0, 0, 0, 0, 0);
}
SpawnPlayer(playerid);
return 1;
}
Das Dumme ist, das es nicht funktioniert!!!
public OnPlayerRequestClass(playerid, classid) {
if(gFirstTimeHasJoined[playerid]) return SetPlayerSpawn(playerid);
PlayerPlaySound(playerid, 1068 , 0.0, 0.0, 0.0);
switch(classid) {
case 0..2: {
SetPlayerTeamFromClass(playerid, classid);
SetPlayerPos(playerid, 1992.1263,-1175.7640,20.1479);
SetPlayerFacingAngle( playerid, 187.0574 );
SetPlayerCameraPos(playerid, 1991.3074,-1179.9628,20.0234);
SetPlayerCameraLookAt(playerid, 1992.1263,-1175.7640,20.1479);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Ballas", 3000, 3);
} case 3..9: {
SetPlayerPos(playerid, 2486.7598,-1647.5186,14.0703);
SetPlayerFacingAngle( playerid, 187.5500 );
SetPlayerCameraPos(playerid, 2486.4346,-1646.0953-5,14.0703);
SetPlayerCameraLookAt(playerid, 2486.7598,-1647.5186,14.0703);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Grove Street", 3000, 3);
} case 10..12: {
SetPlayerPos(playerid, 2571.8352,-1091.2091,66.9639);
SetPlayerFacingAngle(playerid, 48.7203 );
SetPlayerCameraPos(playerid, 2570.1152,-1089.5372,66.8601);
SetPlayerCameraLookAt(playerid, 2571.8352,-1091.2091,66.9639);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Vagos", 3000, 3);
}
}
return 1;
}
Der Spieler kann beliebig oft seine Gang, Skin wahlen! Weiss einer, was da falsch ist????
Meine Variablen:
new gFirstTimeHasJoined[MAX_PLAYERS], gPlayerSkinForEver[MAX_PLAYERS];