16.11.2010, 10:11
Hey everyone,can you tell me what's worng in this script?im so annoyed 
I tried to put the command /taxi start/stop but i just can't make it

I tried to put the command /taxi start/stop but i just can't make it

Код:
if(strcmp(cmd, "/taxi", true) == 0) // by LordMan
{
if(IsPlayerConnected(playerid))
{
new x_nr[128];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /taxi [name]");
SendClientMessage(playerid, COLOR_WHITE, "Available names: start,stop");
return 1;
}
if(strcmp(x_nr,"start",true) == 0)
{
new name[MAX_PLAYER_NAME];
new vehicleid = GetPlayerVehicleID(playerid);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(i, name, sizeof(name));
if(IsPlayerInVehicle(playerid, vehicleid) && GetPlayerState(playerid) == 2 && TransportDuty[playerid] > 0)
{
if(GetPlayerMoney(i) < TransportValue[playerid])
{
format(string, sizeof(string), "* You need $%d to enter.", TransportValue[playerid]);
SendClientMessage(i, COLOR_WHITE, string);
SafeRemovePlayerFromVehicle(i);
}
else
{
if(TransportDuty[playerid] == 1)
{
format(string, sizeof(string), "* You paid $%d to the Taxi Driver.", TransportValue[playerid]);
SendClientMessage(i, COLOR_WHITE, string);
TransportTime[playerid] = 1;
TransportTime[i] = 1;
TransportCost[i] = TransportValue[playerid];
TransportCost[i] = TransportValue[playerid];
TransportDriver[playerid] = playerid;
}
}
}
}
}
}

