28.02.2015, 10:17
Код:
YCMD:meslek(playerid, params[], help) { new meslekID[3]; if(isnull(params)) { SendClientMessage(playerid, -1, "<KULLANIM> /meslek [olustur/duzenle/sil/git]"); } return 1; }
YCMD:meslek(playerid, params[], help) { new meslekID[3]; if(isnull(params)) { SendClientMessage(playerid, -1, "<KULLANIM> /meslek [olustur/duzenle/sil/git]"); } return 1; }
YCMD:meslek(playerid, params[], help)
{
if(isnull(params)) return SendClientMessage(playerid, -1, "<KULLANIM> /meslek [olustur/duzenle/sil/git]");
if(!strcmp(params, "olustur", true))
{
// Code
}
else if(!strcmp(params, "duzenle", true))
{
// Code
}
else if(!strcmp(params, "sil", true))
{
// Code
}
else if(!strcmp(params, "gil", true))
{
// Code
}
return 1;
}
No need to use sscanf if you just have 1 string parameter, you can just use strcmp.
pawn Код:
So strcmp just compares the "params" with the other text we provide, like "gil", and check if it's the same. So if "params" is "gil", then it will activate the code below that. But if you want to have several parameters, like "/meslek [params] [more params]", then you need to use sscanf. |