if(strcmp(cmd, "/changemycolour", true) == 0) { SetPlayerColor(playerid, CHOOSEACOLOR); } return 1; }
Originally Posted by iRape
Ohhk? You just want to change your players color. (In default chat, the color of yourself will be the same when you talk too)
Simple as this. Код:
if(strcmp(cmd, "/changemycolour", true) == 0) { SetPlayerColor(playerid, CHOOSEACOLOR); } return 1; } |
public OnPlayerCommandText(playerid,cmdtext[]) {
new index, cmd[128];
cmd = strtok(cmdtext, index);
if (!strcmp("/color",cmd,true,6)) {
SetPlayerColor(playerid,Color);//COLOR = COLOR
return 1;
}
return 0;
}
//-----------------------------------------
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
if(strcmp(cmd, "/changemycolour", true) == 0) { SetPlayerColor(playerid, CHOOSEACOLOR); } return 1; }
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SAMPSE~1\GAMEMO~1\COPSNR~1.PWN(161) : error 010: invalid function or declaration C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SAMPSE~1\GAMEMO~1\COPSNR~1.PWN(165) : error 010: invalid function or declaration Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
if(strcmp(cmd, "/changemycolour", true) == 0)
{
SetPlayerColor(playerid, CHOOSEACOLOR);
return 1;
}
public OnPlayerCommandText(playerid,cmdtext[]) {
new index, cmd[128];
cmd = strtok(cmdtext, index);
if (!strcmp("/color",cmd,true,6)) {
SetPlayerColor(playerid,Color);//COLOR = COLOR
return 1;
}
return 0;
}
//-----------------------------------------
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
if(strcmp(cmd, "/changemycolour", true) == 0) { SetPlayerColor(playerid, CHOOSEACOLOR); return 1; }
public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp("/drift1", cmdtext, true) == 0) { if(IsPlayerInAnyVehicle(playerid) == 1) { SetVehiclePos(GetPlayerVehicleID(playerid), -334.0647,1528.6570,75.0189); } else { SetPlayerPos(playerid, -329.3348,1536.3771,76.6117); } } if(strcmp("/AA", cmdtext, true) == 0) { if(IsPlayerInAnyVehicle(playerid) == 1) { SetVehiclePos(GetPlayerVehicleID(playerid),406.9412,2437.8621,16.3950); new pvehicleid; SetVehicleZAngle(pvehicleid, 406); } else { SetPlayerPos(playerid,406.9412,2437.8621,16.3950); } } return 1; } if(strcmp(cmd, "/changemycolour", true) == 0) { SetPlayerColor(playerid, CHOOSEACOLOR); return 1; }
public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp("/drift1", cmdtext, true) == 0) { if(IsPlayerInAnyVehicle(playerid) == 1) { SetVehiclePos(GetPlayerVehicleID(playerid), -334.0647,1528.6570,75.0189); } else { SetPlayerPos(playerid, -329.3348,1536.3771,76.6117); } } if(strcmp("/AA", cmdtext, true) == 0) { if(IsPlayerInAnyVehicle(playerid) == 1) { SetVehiclePos(GetPlayerVehicleID(playerid),406.9412,2437.8621,16.3950); new pvehicleid; SetVehicleZAngle(pvehicleid, 406); } else { SetPlayerPos(playerid,406.9412,2437.8621,16.3950); } } return 1; } if(strcmp(cmd, "/changemycolour", true) == 0) { SetPlayerColor(playerid, CHOOSEACOLOR); return 1; }
public OnPlayerCommandText(playerid,cmdtext[]) { new index, cmd[128]; cmd = strtok(cmdtext, index); if (!strcmp("/color",cmd,true,6)) { SetPlayerColor(playerid,Color);//COLOR = COLOR return 1; } return 0; } //----------------------------------------- strtok(const string[], &index) { new length = strlen(string); while ((index < length) && (string[index] <= ' ')) { index++; } new offset = index; new result[20]; while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; }