17.08.2011, 00:21
That could could really be cleaned up..:
1. Why did you specify a length in strcmp? It's just un-needed.
2. Why did you create any variables?
3. Why did you store information in variables and never use them?
4. Why the over-complication?
5. Why check if the player is in a vehicle instead of checking if he is a driver? (Do you want passengers to be able to teleport the vehicle?)
6. Why do you use GetPlayerPos at all?
pawn Код:
if (strcmp("/spawn", cmdtext, true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) SetVehiclePos(GetPlayerVehicleID(playerid), -50.0743,-274.4324,5.4297);
else SetPlayerPos(playerid, -50.0743,-274.4324,5.4297);
return 1;
}
2. Why did you create any variables?
3. Why did you store information in variables and never use them?
4. Why the over-complication?
5. Why check if the player is in a vehicle instead of checking if he is a driver? (Do you want passengers to be able to teleport the vehicle?)
6. Why do you use GetPlayerPos at all?