05.08.2015, 23:06
Quote:
#define DIALOG_RACE2 6 |
Quote:
CMD:race2(playerid, params[]) { if (g_PlayerInRace[playerid] == true) return SendClientMessage(playerid, 0xFF0000AA, "[ERROR]: Ur already on a race!"); if(sscanf(params, "u", target)) return SendClientMessage(playerid, 0xCECECEFF, "[ERROR]: Use: /race2 [ID]"); if(!IsPlayerConnected(target)) return SendClientMessage(playerid, 0xCECECEFF, "[ERROR]: Offline Player!"); new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, MAX_PLAYER_NAME); new String[128]; format(String, sizeof(String), "{00C2EC}You've been challanged by{1B95E0}%s{00C2EC} to the Wood's Race!", pname); ShowPlayerDialog(target, DIALOG_RACE2, DIALOG_STYLE_MSGBOX, "Race", String, "Accept", "Decline"); return 1; } |
Quote:
if(dialogid == DIALOG_RACE2) { if(response) { new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, MAX_PLAYER_NAME); format(string, sizeof(string), "[Tele]: %s started a Race on the Woods! {FF8040}(/Race2)", pname); SendClientMessageToAll(0xFFFF00AA, string); SetPlayerPos(playerid,-1563,-1919,87); SetPlayerInterior(playerid, 0); SetPlayerPos(target,-1563,-1914,86); SetPlayerInterior(target, 0); sandking[playerid]=CreateVehicle(495,-1563,-1919,87,190,random(20), random(20),-1); PutPlayerInVehicle(playerid,sandking[playerid], 0); sandking[playerid]=CreateVehicle(495,-1563,-1914,86,190,random(20), random(20),-1); PutPlayerInVehicle(target,sandking[playerid], 0); TogglePlayerControllable(playerid, 0); TogglePlayerControllable(target, 0); SetTimerEx("start", 3000, false, "i", playerid); SetTimerEx("start", 3000, false, "i", target); GameTextForPlayer(playerid, "~r~Get Ready...", 3000, 4); GameTextForPlayer(target, "~r~Get Ready...", 3000, 4); g_ProgresInRace[playerid] = 15; g_PlayerInRace[playerid] = true; g_ProgresInRace[target] = 15; g_PlayerInRace[target] = true; SetPlayerRaceCheckpoint(playerid, 1, checkpoints[15][0], checkpoints[15][1], checkpoints[15][2], checkpoints[16][0], checkpoints[16][1], checkpoints[16][2], 12.5); SetPlayerRaceCheckpoint(target, 1, checkpoints[15][0], checkpoints[15][1], checkpoints[15][2], checkpoints[16][0], checkpoints[16][1], checkpoints[16][2], 12.5); TextDrawShowForPlayer(playerid, reapir); TextDrawShowForPlayer(playerid, nitro); TextDrawShowForPlayer(playerid, flip); if(g_Ramp[playerid] == 1) { TextDrawShowForPlayer(playerid, ramp); } } if(!response) { } return 1; } |
The X player types /race2 [ID], the Y player recieves a dialog asking if he wants to race or not. Until that part everything is OK, then if the Y player accepts, both of them are going to be teleported and start the race inside of a Sandking car with the checkpoints bein activated.
What happens:
Only the Y player is teleported with the car/checkpoints and all that stuff. Nothing happens to the X player.
Hope you can understand and give me a hand omfg! O_o