if (!strcmp(cmdtext, "/rallymode", true)) { if (!IsPlayerInAnyVehicle(playerid)) return 1; new vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1021); new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "%s has entered rally-mode!", name); SendClientMessageToAll(COLOR_RED, string); SendClientMessage(playerid, COLOR_GOLD, "Rally started!"); SendClientMessage(playerid, COLOR_RED, "Head to the town!"); SetPlayerCheckpoint(playerid,-2098.3074,-2246.2427,30.6250,3.5); if (IsPlayerInCheckpoint(playerid)) SendClientMessageToAll(COLOR_GOLD, "%s has finished the Rally!", name); SendClientMessage(playerid, COLOR_GOLD, "Congratulations on finishing the rally!"); GivePlayerMoney(playerid, 10000); return 1; }
new string[64];
format(string, sizeof(string), "%s has finished the Rally!", name);
SendClientMessageToAll(COLOR_GOLD, string);
You have to format the message first.
pawn Код:
|
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/rallymode", true))
{
if (!IsPlayerInAnyVehicle(playerid)) return 1;
new vehicleid = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehicleid, 1021);
new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s has entered rally-mode!", name);
SendClientMessageToAll(COLOR_RED, string);
SendClientMessage(playerid, COLOR_GOLD, "Rally started!");
SendClientMessage(playerid, COLOR_RED, "Head to the town!");
SetPlayerCheckpoint(playerid,-2098.3074,-2246.2427,30.6250,3.5);
return 1;
}
return 0;
}
public OnPlayerEnterCheckpoint(playerid)
{
SendClientMessageToAll(COLOR_GOLD, "%s has finished the Rally!", name);
SendClientMessage(playerid, COLOR_GOLD, "Congratulations on finishing the rally!");
GivePlayerMoney(playerid, 10000);
DisablePlayerCheckpoint(playerid);
return 1;
}
SendClientMessageToAll(COLOR_GOLD, "%s has finished the Rally!", name);
if (!strcmp(cmdtext, "/rallymode", true)) { if (!IsPlayerInAnyVehicle(playerid)) return 1; new vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1021); new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "%s has entered rally-mode!", name); SendClientMessageToAll(COLOR_RED, string); SendClientMessage(playerid, COLOR_GOLD, "Rally started!"); SendClientMessage(playerid, COLOR_RED, "Head to the town!"); SetPlayerCheckpoint(playerid,-2098.3074,-2246.2427,30.6250,3.5); Create3DTextLabel("Slow down!", COLOR_RED, -2173.2581, -1997.3176, 118.9902, 35, 0, 0); if (IsPlayerInCheckpoint(playerid)) { new stringz[64]; format(stringz, sizeof(stringz), "%s has finished the Rally!", name); SendClientMessageToAll(COLOR_GOLD, string); SendClientMessage(playerid, COLOR_GOLD, "Congratulations on finishing the rally!"); GivePlayerMoney(playerid, 10000); } return 1; }
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/rallymode", true))
{
if (!IsPlayerInAnyVehicle(playerid)) return 1;
new vehicleid = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehicleid, 1021);
new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s has entered rally-mode!", name);
SendClientMessageToAll(COLOR_RED, string);
SendClientMessage(playerid, COLOR_GOLD, "Rally started!");
SendClientMessage(playerid, COLOR_RED, "Head to the town!");
SetPlayerCheckpoint(playerid,-2098.3074,-2246.2427,30.6250,3.5);
Create3DTextLabel("Slow down!", COLOR_RED, -2173.2581, -1997.3176, 118.9902, 35, 0, 0);
return 1;
}
return 0;
}
public OnPlayerEnterCheckpoint(playerid)
{
new stringz[64], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(stringz, sizeof(stringz), "%s has finished the Rally!", name);
SendClientMessageToAll(COLOR_GOLD, string);
SendClientMessage(playerid, COLOR_GOLD, "Congratulations on finishing the rally!");
GivePlayerMoney(playerid, 10000);
DisablePlayerCheckpoint(playerid);
return 1;
}