27.01.2010, 08:26
Heres a more efficient version of your code
As for your bug I assume you added dcmd("p",1, cmdtext); to your OnPlayerCommandText?
As for your bug I assume you added dcmd("p",1, cmdtext); to your OnPlayerCommandText?
pawn Код:
dcmd_p(playerid,params[])
{
new vehicleid;
if(strlen(params) == 0) return SendClientMessage(playerid, red, "Usage: /p (Text)");
for (new i = 0; i < GetMaxPlayers(); i++)
{
if(!IsPlayerConnected(i) || !IsPlayerInAnyVehicle(i)) continue;
vehicleid = GetPlayerVehicleID(i);
switch(GetVehicleModel(vehicleid))
{
case 417 ,425, 447, 592, 577, 511, 512,
593, 520, 553, 476, 519, 460, 513, 548,
425, 417, 487, 488, 497, 563, 447, 469:
{
new string[128];
new plName[MAX_PLAYER_NAME];
GetPlayerName(playerid, plName, sizeof(plName));
format(string,sizeof(string),"Pilot Chat: %s: %s",plName, params);
SendClientMessage(i, green, string);
}
}
return 1;
}
return 1;
}