All pastes #451242 Raw Edit

mabako

public cpp v1 · immutable
·published 2007-04-21 10:34 UTC
rendered paste body
public OnPlayerCommandText(playerid, cmdtext[]){	if(strcmp(cmdtext, "/right", true, 6)==0) { // 6 is the length of /right	    if(strlen(cmdtext) <= 7 || strlen(cmdtext) > 10) {	        // This will stop if you command is either	        // "/report "	        // or just "/report". Isn't perfect at all, since /reportx12 is also valid and takes the 12 as number	        // Also, there's a bug if strval(below) has to do > 50 chars, but we don't want more than	        // 10, at all	        // "/right 20" is exactly 9 chars, but it shouldn't make a big difference :p	        SendClientMessage(playerid, 0xFFFF00AA, "Usage: /right <id>");	        return 1;	    }	    if(IsPlayerConnected(strval(cmdtext[7]))) {	        new str[128], pname[MAX_PLAYER_NAME];	        GetPlayerName(strval(cmdtext[7]), pname, MAX_PLAYER_NAME);	        format(str, 128, "%s, drive on the right side and stop the car", pname, cmdtext[4]);	        SendClientMessageToAll(0xFFFF00AA, str);	    } else {	        SendClientMessage(playerid, 0xFFFF00AA, "This player is not connected");	    }	    return 1;    }	return 0;}